$(".search").click(function () {
    var data = $("#searchform").serialize();
    window.location.href = '/admin/tales/index?' + data;
});

/**删除***/
$(".del").click(function () {
    var id = $(this).attr('data-id');
    var confirm_msg = "确认删除吗?";
    if (confirm(confirm_msg)) {
        $.ajax({
            url: '/admin/tales/delIndex',
            type: 'POST',
            data: {id: id},
            dataType: 'JSON',
            cache: false,
            success: function (json) {
                dshow(json.message);
                if (json.code == 2000) {
                    window.location.href = '/admin/tales/index';
                }
            }
        });
    }
});

/***编辑**/
$(".edit").click(function () {
    var id = $(this).attr('data-id');
    window.location.href = '/admin/tales/edit?id=' + id;
});


